const Router = require("@koa/router");
const router = new Router();

const { koaBody } = require("koa-body");
const uploadController = require("../controllers/uploadController");

const koaBodyConfig = {
  multipart: true, // 解析多部分主体
  maxFieldsSize: 50 * 1024 * 1024,
};

router.use(koaBody(koaBodyConfig));

router.post("/upload", uploadController.upload);

module.exports = router;
